package dynamic;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author liuchaoqun
 * @date 2022/7/19
 * @Description 爬楼梯
 */
public class ClimFloor {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Integer sum = in.nextInt();
        System.out.println(climbStairs(sum));
    }

    private static Integer climbStairs(Integer sum) {
        int[] allMethods = new int[45];
        allMethods[1] = 1;
        allMethods[2] = 2;

        // 动态规划 1.定义n代表的意思 2.初始化  3.找关系

        // n代表第n个台阶有[n]中方法 [1]=1 [2]=2 [3]=[2]+[1] [4]=[2]+[3]
        for (int i = 3; i <= sum; i++) {
            allMethods[i] = allMethods[i - 1] + allMethods[i - 2];
        }

        return allMethods[sum];
    }

}
